1. Field of the Invention
This invention relates to a data encoding apparatus, a data encoding method, and a recording medium recorded with a program for encoding fixed length encoding subject data.
2. Description of Related Art
It is generally known that when encoded data are stored at a fixed length and an error occurs during transmission or the like, further data expansion may become impossible.
Hence, international standard encoding methods such as JPEG prescribe a technique of attaching restart markers to the encoded data at appropriate intervals such that even when an error occurs in a part of the data, expansion of the encoded data can be resumed from the position of the subsequent restart marker. An example of this technique is described in Japanese Unexamined Patent Application Publication H9-247423.
By providing restart markers, not only is error resistance enhanced, but it also becomes possible to expand a desired part of the data alone at high speed, and also to expand the parts of the encoded data defined by the restart markers in parallel, leading to a reduction in the processing time.
Conventionally, Golomb-Rice encoding is employed in JPEG-LS and the like. When restart markers are embedded into Golomb-Rice encoded data, it is impossible to determine the presence of a restart marker simply by sequential reading, and therefore offset information indicating the positions of the restart markers must be provided separately. Information having a so-called chain structure, denoted by the byte count from a certain restart marker to the next restart marker or the like, may be used as the offset information. With this technique, even when the data of a certain bit position within the encoded data are rewritten, decoding can be resumed from the position of the subsequent restart marker.
However, with a technique such as that described above, in which restart markers are embedded in Golomb-Rice encoded data as a control code using offset information, the position of the restart marker may deviate from the position indicated by the offset information due to missing data, the attachment of error information, and so on at a point in the data, and hence the position of the restart marker cannot be specified even though the restart marker exists. As a result, it may become impossible to decode the information. Furthermore, since the offset information takes a chain structure, damage to the position information of a certain restart marker causes similar damage to the position information of the subsequent restart markers.
Therefore, the degree of error resistance of a conventional restart marker which can be applied to Golomb-Rice encoding and so on cannot be said to be sufficiently high. For this reason, it is desirable that a technique of attaching restart markers which have a higher degree of error resistance and are not dependent on offset information be developed.